package com.commerce.order.feign;

import com.commerce.common.entity.Product;
import com.commerce.common.utils.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 产品服务Feign客户端降级实现
 */
@Component
public class ProductFeignFallback implements ProductFeignClient {
    private static final Logger logger = LoggerFactory.getLogger(ProductFeignFallback.class);

    @Override
    public Result<Product> getProductById(Long id) {
        logger.error("产品服务调用失败，进入降级逻辑: getProductById, id={}", id);
        return Result.error("产品服务不可用");
    }

    @Override
    public Result<List<Product>> getProductsByIds(List<Long> ids) {
        logger.error("产品服务调用失败，进入降级逻辑: getProductsByIds, ids={}", ids);
        return Result.error("产品服务不可用");
    }
} 